"""Cadena Form"""

from lex.widgets.mi_validador.mi_validador import *

from tw.forms import TableForm, Spacer, TextField, PasswordField, \
    CalendarDatePicker, TextArea
from tw.forms.fields import Button, SubmitButton, HiddenField, CheckBox
from tw.forms.validators import *


class CadenaForm(TableForm):

    hover_help = True
    show_errors = True

    fields = [
        HiddenField('id_analizador_lexico', label_text='Id'),
        Spacer(),
        TextField('definicion_cadena', validator=NotEmpty, label_text='Definicion', size=50,
            help_text='Introduzca una cadena de entrada...'),
        Spacer()]

    submit_text = 'Guardar Cadena'

class EditCadenaForm(TableForm):

    hover_help = True
    show_errors = True

    fields = [
        HiddenField('id_cadena', label_text='Id'),
        HiddenField('id_analizador_lexico', label_text='Id'),
        Spacer(),
        TextField('definicion_cadena', validator=NotEmpty, label_text='Definicion', size=50,
            help_text='Introduzca una cadena de entrada...'),
        Spacer()]

    submit_text = 'Guardar Cambios'
    
crear_cadena_form = CadenaForm("CrearCadena", action='add')
editar_cadena_form = EditCadenaForm("EditarCadena", action='update')
